home *** CD-ROM | disk | FTP | other *** search
- return
-
- customisehotkeys:
-
- start2:
- showagain:
-
- gosub, readhotkeys
-
- ControlGetPos, X, Y, Width, Height, SysListView321, Program Manager
-
- Width/=2
- Height/=2
-
- Height-=110
- Width-=293
-
- Gui, Show, x%Width% y%Height% h240 w585 , HJTHotkey - Customise Hotkeys
-
-
- IniRead, key1, keys.ini, key1, Hotkeys
- IniRead, key2, keys.ini, key2, Secondkeys
-
- winwait, HJTHotkey
-
- i=1
-
-
- Loop, parse, Key1, `,
- {
-
- if i=1
- Control, ChooseString, %A_Loopfield%, Combobox1, HJTHotkey
-
- if i=2
- Control, ChooseString, %A_Loopfield%, Combobox2, HJTHotkey
-
- if i=3
- Control, ChooseString, %A_Loopfield%, Combobox3, HJTHotkey
-
- if i=4
- Control, ChooseString, %A_Loopfield%, Combobox4, HJTHotkey
-
-
- if i=5
- Control, ChooseString, %A_Loopfield%, Combobox5, HJTHotkey
-
-
- if i=6
- Control, ChooseString, %A_Loopfield%, Combobox6, HJTHotkey
-
- if i=7
- Control, ChooseString, %A_Loopfield%, Combobox7, HJTHotkey
-
-
- if i=8
- Control, ChooseString, %A_Loopfield%, Combobox8, HJTHotkey
-
- if i=9
- Control, ChooseString, %A_Loopfield%, Combobox9, HJTHotkey
-
-
- i++
-
- }
-
-
- IniRead, key2, keys.ini, key2, Secondkeys
-
- SetControlDelay,30
-
- i=1
-
- Loop, parse, Key2, `,
- {
-
- if i=1
- ControlSetText, Edit1, %A_Backspace%%A_Loopfield%, HJTHotkey
-
- if i=2
- ControlSetText, Edit2, %A_Backspace%%A_Loopfield%, HJTHotkey
-
- if i=3
- ControlSetText, Edit3, %A_Backspace%%A_Loopfield%, HJTHotkey
-
- if i=4
- ControlSetText, Edit4, %A_Backspace%%A_Loopfield%, HJTHotkey
-
-
-
- if i=5
- ControlSetText, Edit5, %A_Backspace%%A_Loopfield%, HJTHotkey
-
- if i=6
- ControlSetText, Edit6, %A_Backspace%%A_Loopfield%, HJTHotkey
-
- if i=7
- ControlSetText, Edit7, %A_Backspace%%A_Loopfield%, HJTHotkey
-
- if i=8
- ControlSetText, Edit8, %A_Backspace%%A_Loopfield%, HJTHotkey
-
- if i=9
- ControlSetText, Edit9, %A_Backspace%%A_Loopfield%, HJTHotkey
-
- i++
-
- }
-
- Return
-
- Submit:
-
- Gui, submit
- ;Gui, cancel
-
-
- instruct=Google=%google1%%google2%`nSysinfo(bho)=%sysinfob1%%sysinfob2%`nSysinfo(startup)=%sysinfos1%%sysinfos2%`nProcesses=%process1%%process2%`nBHO=%bho1%%bho2%`nToolbar=%toolbar1%%toolbar2%`nCWS=%cws1%%cws2%`nIEClose=%ie1%%ie2%`nNotepad=%notepad1%%notepad2%
-
- Hotkeys=%google1%,%sysinfob1%,%sysinfos1%,%process1%,%bho1%,%toolbar1%,%cws1%,%ie1%,%notepad1%
-
- Secondkeys=%google2%,%sysinfob2%,%sysinfos2%,%process2%,%bho2%,%toolbar2%,%cws2%,%ie2%,%notepad2%
-
-
- AllHotkeys=%google1%%google2%,%sysinfob1%%sysinfob2%,%sysinfos1%%sysinfos2%,%process1%%process2%,%bho1%%bho2%,%toolbar1%%toolbar2%,%cws1%%cws2%,%ie1%%ie2%,%notepad1%%notepad2%
-
- IniWrite, %Hotkeys%, keys.ini, key1, Hotkeys
- IniWrite, %Secondkeys%, keys.ini, key2, Secondkeys
-
- i=0
-
- Loop, parse, Hotkeys, `,
- {
-
- i++
-
- if A_LoopField=Ctrl
- StringReplace,keys,A_LoopField,Ctrl,^, all
-
- if A_LoopField=Alt
- StringReplace,keys,A_LoopField,Alt,!, all
-
- if A_LoopField=Win
- StringReplace,keys,A_LoopField,Win,#, all
-
- if A_LoopField=MClick
- StringReplace,keys,A_LoopField,MClick,~Mbutton &%a_space%, all
-
- if A_LoopField=LClick
- StringReplace,keys,A_LoopField,LClick,~Lbutton &%a_space%, all
-
-
- if i=1
- google1=%keys%
-
- if i=2
- sysinfob1=%keys%
-
- if i=3
- sysinfos1=%keys%
-
- if i=4
- process1=%keys%
-
- if i=5
- bho1=%keys%
-
- if i=6
- toolbar1=%keys%
-
- if i=7
- cws1=%keys%
-
- if i=8
- ie1=%keys%
-
- if i=9
- notepad1=%keys%
-
- }
-
- Loop, parse, Secondkeys, `,
- {
- StringLen, Number, A_Loopfield
-
- if Number>1
- {
- msgbox, "%A_Loopfield%" is an invalid hotkey.`nHotkeys must only have one letter in them.`n`nPlease try again.
- goto, start2
- }
-
- }
-
- a=0
- b=0
-
- Loop, parse, AllHotkeys, `,
- {
- a++
- key=%A_Loopfield%
-
- Loop, parse, AllHotkeys, `,
- {
-
- if a<>%a_index%
- {
- if A_Loopfield=%key%
- {
- msgbox, "%A_Loopfield%" is an invalid hotkey.`nHotkeys cannot be specified twice.`n`nPlease try again.
- goto, start2
- }
- }
-
- }
-
- }
-
-
-
- ini=[Hotkeys]`nGoogle=%google1%%google2%`nSysinfo(bho)=%sysinfob1%%sysinfob2%`nSysinfo(startup)=%sysinfos1%%sysinfos2%`nProcesses=%process1%%process2%`nBHO=%bho1%%bho2%`nToolbar=%toolbar1%%toolbar2%`nCWS=%cws1%%cws2%`nIEClose=%ie1%%ie2%`nNotepad=%notepad1%%notepad2%
-
- ifexist, hotkeys.ini
- filedelete,hotkeys.ini
- fileappend,%ini%,hotkeys.ini
-
- gosub, readhotkeys
-
- reload
-
- readhotkeys:
-
- IniRead, G, hotkeys.ini, Hotkeys, Google, ^g
- IniRead, SB, hotkeys.ini, Hotkeys, Sysinfo(bho),^b
- IniRead, SS, hotkeys.ini, Hotkeys, Sysinfo(startup), ^s
- IniRead, P, hotkeys.ini, Hotkeys, processes, !a
- IniRead, B, hotkeys.ini, Hotkeys, BHO, !b
- IniRead, T, hotkeys.ini, Hotkeys, Toolbar, !t
- IniRead, C, hotkeys.ini, Hotkeys, CWS , !c
- IniRead, IE, hotkeys.ini, Hotkeys, IEClose, ^z
- IniRead, N, hotkeys.ini, Hotkeys, Notepad , ^n
-
- Hotkey,%G%, Google
- hotkey,%SB%,Sysinfo(bho)
- hotkey,%SS%,Sysinfo(startup)
- hotkey,%P%, processes
- hotkey,%B%, BHO
- hotkey,%T%, Toolbar
- hotkey,%C%, CWS
- hotkey,%IE%,IEClose
- hotkey,%N%, Notepad
-
- return
-
- Cancel:
- gui, cancel
- exit
- return
-
- Defaults:
- filedelete,hotkeys.ini
- fileappend,[Hotkeys]`nGoogle=^g`nSysinfo(bho)=^b`nSysinfo(startup)=^s`nProcesses=!a`nBHO=!b`nToolbar=!t`nCWS=!c`nIEClose=^z`nNotepad=^n`n,hotkeys.ini
-
-
- filedelete,keys.ini
- fileappend,[key1]`nHotkeys=Ctrl`,Ctrl`,Ctrl`,Alt`,Alt`,Alt`,Alt`,Ctrl`,Ctrl`n`n[key2]`nSecondkeys=g`,b`,s`,a`,b`,t`,c`,z`,n, keys.ini
-
- goto, showagain
-
- return